package com.lucas.test.service;

import com.lucas.spring.annotation.Autowired;
import com.lucas.spring.annotation.Component;
import com.lucas.spring.interfaces.BeanNameAware;
import com.lucas.spring.interfaces.InitializingBean;

/**
 * @author: LiuCheng
 * @description:
 * @date: 2023-11-26 13:17
 **/
@Component
public class PersonService implements BeanNameAware, InitializingBean {

    @Autowired
    private UserService userService;

    private String beanName;

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    public void test(){
        System.out.println("测试BeanNameAware接口---------beanName: "+beanName+"\n");
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println(this+"初始化---------------------");
    }
}
